package com.thti.mecool.client.command.result.user;

import android.os.Bundle;
import android.os.Message;

import com.thti.mecool.client.activity.UpdatePasswdActivity;
import com.thti.mecool.client.command.ICommand;
import com.thti.mecool.client.protocol.user.UserChangePasswordResult;
import com.thti.mecool.client.service.Protocol;

public class UpdateUserCommand implements ICommand {

	@Override
	public void doCommand(Object o) {
		UserChangePasswordResult result = (UserChangePasswordResult) o;

		Message msg = new Message();
		Bundle bundle = new Bundle();
		bundle.putSerializable("messageinfo", result.getMsg());
		msg.setData(bundle);
		if(result.getStatus()==1){
				msg.what=0xAA;
				UpdatePasswdActivity.handler.sendMessage(msg);
		}else{
				msg.what=0xBB;
				UpdatePasswdActivity.handler.sendMessage(msg);
		}
	}

	@Override
	public String getCommandID() {
		// TODO Auto-generated method stub
		return Protocol.getChangepassword;
	}

	@Override
	public Class<?> getCommandClass() {

		// TODO Auto-generated method stub
		return UserChangePasswordResult.class;
	}

}
